//package com.example.controller;
//
//import java.util.List;
//import java.util.Properties;
//
//import com.alibaba.fastjson.JSONObject;
//import com.example.domain.MailBody;
//import com.example.service.MailService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.example.domain.EmailEntity;
//import com.example.service.EmailService;
//
//import lombok.extern.slf4j.Slf4j;
//
//import javax.mail.Authenticator;
//import javax.mail.PasswordAuthentication;
//import javax.mail.Session;
//
///**
// * 企业邮箱
// * @author user
// *
// */
//@Slf4j
//@RestController
//@RequestMapping("/email")
//public class EmailController {
//
//	@Autowired
//    private EmailService emailService;
//
//    @Autowired
//    private MailService mailService;
//
//	@RequestMapping("/getToken")
//    public String getLoginToken(){
//		String token = emailService.queryToken();
//		log.info("获取企业邮箱token:{}",token);
//        return token;
//    }
//
//	@RequestMapping("/test")
//    public JSONObject sendMail(@RequestBody MailBody mailBody) {
//        JSONObject res = new JSONObject();
//        boolean status = mailService.sendMail(mailBody);
//        res.put("code", status ? 200 : 500);
//        res.put("msg", status ? "发送成功" : "发送失败");
//        return res;
//    }
//
//}
//
